<?php
require_once('../phplib/include.inc.php');

class DoDeleteProduct{
	public function DoDelete(){
		if(!isset($_REQUEST['pid'])) PageBase::Error('非法访问.');
		$pid = intval($_REQUEST['pid']);
		Util::ValidateRight(array(1,$pid*10+2),'or');
		/* @var $db DbMySQL */
		$db = getDb();
		$db->connect();
		$sjmm = $db->fetchScalar("SELECT sjmm FROM product_t WHERE pid=$pid");
		$re = $db->execute("DELETE FROM product_t WHERE pid=$pid");
		if($re === false){
			PageBase::Error('删除焊接数据时出错，未知错误，请与技术人员联系.');
		}
		Util::AddLog("删除焊接数据：".$sjmm."  该焊接数据的id为: $pid ");
		PageBase::Go('../home/productadmin.php');
	}
}
$dodeleteproduct = new DoDeleteProduct();
$dodeleteproduct->DoDelete();
?>